#ifndef INDEX_H
#define INDEX_H

#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QtDebug>
#include <QTextCodec>
#include <QMessageBox>
#include <QByteArray>
#include <QJsonObject>
#include <QNetworkInterface>
#include <QNetworkCookie>
#include <QNetworkCookieJar>
#include <QNetworkRequest>
#include <QString>
#include <QVariant>
#include <QList>
#include <QRegExp>

namespace Ui {
class Index;
}

class Index : public QWidget
{
    Q_OBJECT

public:
    explicit Index(QWidget *parent = 0);
    ~Index();

private slots:
    void get_finished(QNetworkReply *reply);
    void post_finished(QNetworkReply *reply);
    void leave_finished(QNetworkReply *reply);
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

private:
    Ui::Index *ui;
    QNetworkAccessManager *get_nam;
    QNetworkAccessManager *post_nam;
    QNetworkAccessManager *leave_nam;
    QJsonObject getIpMAC();
    QString *get_url;
    QString *post_url;
    QString *leave_url;
    void getCookie(QString &usr,  QString &pwd);
    void do_get_cookie(QString url, QString content);
    void do_get(QString url, QString content);
};

#endif // INDEX_H
